<?php

class Common_Template extends Zend_View {

    static private $str_script_path = null;
    static private $arr_helper_paths = array();

    public function __construct($arr_options = array()) {

        parent::__construct();

        try {

            $arr_helpers = isset($arr_options['helper_path'])
                ? $arr_options['helper_path']
                : self::$arr_helper_paths;

            if(!empty($arr_helpers) && is_array($arr_helpers)) {

                list($str_path, $str_prefix) = each($arr_helpers);
                $this->setHelperPath($str_path, $str_prefix);

                foreach($arr_helpers as $str_path => $str_prefix) {
                    $this->addHelperPath($str_path, $str_prefix);
                }
            }

            $str_script_path = isset($arr_options['script_path'])
                ? $arr_options['script_path']
                : self::$str_script_path;

            if(!empty($str_script_path)) {
                $this->setScriptPath($str_script_path);
            }

        } catch (Exception $obj_exception) {}

    }

    public function configure($arr_options) {

        if(isset($arr_options['script_path'])) {
            self::$str_script_path = $arr_options['script_path'];
        }

        if(isset($arr_options['helper_path'])) {
            self::$arr_helper_paths = $arr_options['helper_path'];
        }
        
    }

}
